#!/usr/bin/python3
''' judge user exist or not exist '''

import subprocess
f_passwd = subprocess.getoutput("cat /etc/passwd")
f_lines = f_passwd.splitlines()
'''
a = []
for i in f_lines:
    a.append(i.split(":")[0])
'''
a = [x.split(":")[0] for x in f_lines]
u_name = input("please input a user's name:")
if u_name in a:
    print("the user %s is exist" % u_name)
else:
    print("the user %s is not exist" % u_name)
